package com.tzy.order.service;
import com.tzy.common.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
/**
 * 远程调用user模块的接口
 */
@Component//标识为组件
@FeignClient(name = "user")//feign客户端通过动态代理//出错的概率小一些
public interface UserServiceRpc {
    //映射地址, 通过反射获取 ServiceId,url ,Class
    @GetMapping("/user/info/{id}")
    User getUserInfoById(@PathVariable("id") int serviceId);
    @PutMapping("/user/add")
    int insert(@RequestBody User user);
}
